﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MVC4Demo.Model;

namespace MVC4Demo.Web.Controllers
{
    public class OrderController : Controller
    {
        OrderRepository _repository;
        IList<OrderRepository> _repositoryList;

        public OrderController()
        {
            _repository = new OrderRepository();
        }

        //
        // GET: /Order/

        //public ActionResult Index()
        //{
        //    return View();
        //}

        public ActionResult Index()
        {
            //var session = FeestBeest.Web.MvcApplication.SessionFactory.GetCurrentSession();
            IList<Order> orderList = _repository.GetOrderList();

          //using (ISession session = NHIbernateSession.OpenSession())
          //{
          //    var vOrder = session.QueryOver<Order>().List();
          //    return View(vOrder);
          //}
          //  List<Order> vOrder = new List<Order>();
            return View(orderList);
        }
    
    }
}